package com.liwang.lanouhn.nvshengo.adapter;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.liwang.lanouhn.nvshengo.Info.ClothespressInfo;
import com.liwang.lanouhn.nvshengo.Info.Info;
import com.liwang.lanouhn.nvshengo.R;
import com.liwang.lanouhn.nvshengo.activities.LunBoDetailsActivity;
import com.liwang.lanouhn.nvshengo.view.RecyclerImageView;
import com.squareup.picasso.Picasso;

import java.util.List;

/**
 * Created by lanouhn on 2016/10/19.
 */
public class ClothesRecyclerviewAdapter extends RecyclerView.Adapter<ClothesRecyclerviewAdapter.ClothesRecyclerviewViewHolder> {
    private Context context;
    private ClothespressInfo clothespressInfo;


    public ClothesRecyclerviewAdapter(Context context, ClothespressInfo clothespressInfo) {
        this.context = context;
        this.clothespressInfo = clothespressInfo;
    }

    @Override

    public ClothesRecyclerviewViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_clothesrecyclerview, null);
        ClothesRecyclerviewViewHolder holder = new ClothesRecyclerviewViewHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(ClothesRecyclerviewViewHolder holder, int position) {
        final List<ClothespressInfo.DataBean.CBClothingBean.ListBean> listBeen = clothespressInfo.getData().getCB_clothing().getList();
        final List<ClothespressInfo.DataBean.NPPClothingBean.ListBean> listBeens = clothespressInfo.getData().getNPP_clothing().getList();

        if (position == 0) {
            Picasso.with(context).load(listBeen.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_title);
            Picasso.with(context).load(listBeens.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_one);
            holder.head_one.setText(listBeens.get(0).getTitle());
            holder.title_one.setText(listBeens.get(0).getViceTitle());
            Picasso.with(context).load(listBeens.get(1).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_two);
            holder.head_two.setText(listBeens.get(1).getTitle());
            holder.title_two.setText(listBeens.get(1).getViceTitle());
            Picasso.with(context).load(listBeens.get(2).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_there);
            holder.head_there.setText(listBeens.get(2).getTitle());
            holder.title_there.setText(listBeens.get(2).getViceTitle());
            Picasso.with(context).load(listBeens.get(3).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_four);
            holder.head_four.setText(listBeens.get(3).getTitle());
            holder.title_four.setText(listBeens.get(3).getViceTitle());
            Picasso.with(context).load(listBeens.get(4).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_five);
            holder.head_five.setText(listBeens.get(4).getTitle());
            holder.title_five.setText(listBeens.get(4).getViceTitle());
            holder.iv_title.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen.get(0).getTitle());
                    info.setUrl(listBeen.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_one.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeens.get(0).getTitle());
                    info.setUrl(listBeens.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_two.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info1 = new Info();
                    info1.setTitle(listBeens.get(1).getTitle());
                    info1.setUrl(listBeens.get(1).getLink());
                    Intent intent1 = new Intent(context, LunBoDetailsActivity.class);
                    intent1.putExtra("info", info1);
                    context.startActivity(intent1);
                }
            });
            holder.ll_there.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeens.get(2).getTitle());
                    info.setUrl(listBeens.get(2).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_four.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeens.get(3).getTitle());
                    info.setUrl(listBeens.get(3).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_five.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeens.get(4).getTitle());
                    info.setUrl(listBeens.get(4).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });

        } else if (position == 1) {
            final List<ClothespressInfo.DataBean.CBShoesBean.ListBean> listBeen1 = clothespressInfo.getData().getCB_shoes().getList();
            final List<ClothespressInfo.DataBean.NPPShoesBean.ListBean> listBeen1s = clothespressInfo.getData().getNPP_shoes().getList();
            Picasso.with(context).load(listBeen1.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_title);
            Picasso.with(context).load(listBeen1s.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_one);
            holder.head_one.setText(listBeen1s.get(0).getTitle());
            holder.title_one.setText(listBeen1s.get(0).getViceTitle());
            Picasso.with(context).load(listBeen1s.get(1).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_two);
            holder.head_two.setText(listBeen1s.get(1).getTitle());
            holder.title_two.setText(listBeen1s.get(1).getViceTitle());
            Picasso.with(context).load(listBeen1s.get(2).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_there);
            holder.head_there.setText(listBeen1s.get(2).getTitle());
            holder.title_there.setText(listBeen1s.get(2).getViceTitle());
            Picasso.with(context).load(listBeen1s.get(3).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_four);
            holder.head_four.setText(listBeen1s.get(3).getTitle());
            holder.title_four.setText(listBeen1s.get(3).getViceTitle());
            Picasso.with(context).load(listBeen1s.get(4).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_five);
            holder.head_five.setText(listBeen1s.get(4).getTitle());
            holder.title_five.setText(listBeen1s.get(4).getViceTitle());
            holder.iv_title.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen1.get(0).getTitle());
                    info.setUrl(listBeen1.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_one.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen1s.get(0).getTitle());
                    info.setUrl(listBeen1s.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_two.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info1 = new Info();
                    info1.setTitle(listBeen1s.get(1).getTitle());
                    info1.setUrl(listBeen1s.get(1).getLink());
                    Intent intent1 = new Intent(context, LunBoDetailsActivity.class);
                    intent1.putExtra("info", info1);
                    context.startActivity(intent1);
                }
            });
            holder.ll_there.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen1s.get(2).getTitle());
                    info.setUrl(listBeen1s.get(2).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_four.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen1s.get(3).getTitle());
                    info.setUrl(listBeen1s.get(3).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_five.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen1s.get(4).getTitle());
                    info.setUrl(listBeen1s.get(4).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });

        } else if (position == 2) {
            final List<ClothespressInfo.DataBean.CBBoyfriendBean.ListBean> listBeen2 = clothespressInfo.getData().getCB_boyfriend().getList();
            final List<ClothespressInfo.DataBean.NPPBoyfriendBean.ListBean> listBeen2s = clothespressInfo.getData().getNPP_boyfriend().getList();
            Picasso.with(context).load(listBeen2.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_title);
            Picasso.with(context).load(listBeen2s.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_one);
            holder.head_one.setText(listBeen2s.get(0).getTitle());
            holder.title_one.setText(listBeen2s.get(0).getViceTitle());
            Picasso.with(context).load(listBeen2s.get(1).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_two);
            holder.head_two.setText(listBeen2s.get(1).getTitle());
            holder.title_two.setText(listBeen2s.get(1).getViceTitle());
            Picasso.with(context).load(listBeen2s.get(2).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_there);
            holder.head_there.setText(listBeen2s.get(2).getTitle());
            holder.title_there.setText(listBeen2s.get(2).getViceTitle());
            Picasso.with(context).load(listBeen2s.get(3).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_four);
            holder.head_four.setText(listBeen2s.get(3).getTitle());
            holder.title_four.setText(listBeen2s.get(3).getViceTitle());
            Picasso.with(context).load(listBeen2s.get(4).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_five);
            holder.head_five.setText(listBeen2s.get(4).getTitle());
            holder.title_five.setText(listBeen2s.get(4).getViceTitle());
            holder.iv_title.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen2.get(0).getTitle());
                    info.setUrl(listBeen2.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_one.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen2s.get(0).getTitle());
                    info.setUrl(listBeen2s.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_two.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info1 = new Info();
                    info1.setTitle(listBeen2s.get(1).getTitle());
                    info1.setUrl(listBeen2s.get(1).getLink());
                    Intent intent1 = new Intent(context, LunBoDetailsActivity.class);
                    intent1.putExtra("info", info1);
                    context.startActivity(intent1);
                }
            });
            holder.ll_there.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen2s.get(2).getTitle());
                    info.setUrl(listBeen2s.get(2).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_four.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen2s.get(3).getTitle());
                    info.setUrl(listBeen2s.get(3).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_five.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen2s.get(4).getTitle());
                    info.setUrl(listBeen2s.get(4).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });

        } else if (position == 3) {
            final List<ClothespressInfo.DataBean.CBBagsBean.ListBean> listBeen3 = clothespressInfo.getData().getCB_bags().getList();
            final List<ClothespressInfo.DataBean.NPPBagsBean.ListBean> listBeen3s = clothespressInfo.getData().getNPP_bags().getList();
            Picasso.with(context).load(listBeen3.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_title);
            Picasso.with(context).load(listBeen3s.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_one);
            holder.head_one.setText(listBeen3s.get(0).getTitle());
            holder.title_one.setText(listBeen3s.get(0).getViceTitle());
            Picasso.with(context).load(listBeen3s.get(1).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_two);
            holder.head_two.setText(listBeen3s.get(1).getTitle());
            holder.title_two.setText(listBeen3s.get(1).getViceTitle());
            Picasso.with(context).load(listBeen3s.get(2).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_there);
            holder.head_there.setText(listBeen3s.get(2).getTitle());
            holder.title_there.setText(listBeen3s.get(2).getViceTitle());
            Picasso.with(context).load(listBeen3s.get(3).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_four);
            holder.head_four.setText(listBeen3s.get(3).getTitle());
            holder.title_four.setText(listBeen3s.get(3).getViceTitle());
            Picasso.with(context).load(listBeen3s.get(4).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_five);
            holder.head_five.setText(listBeen3s.get(4).getTitle());
            holder.title_five.setText(listBeen3s.get(4).getViceTitle());
            holder.iv_title.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen3.get(0).getTitle());
                    info.setUrl(listBeen3.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_one.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen3s.get(0).getTitle());
                    info.setUrl(listBeen3s.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_two.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info1 = new Info();
                    info1.setTitle(listBeen3s.get(1).getTitle());
                    info1.setUrl(listBeen3s.get(1).getLink());
                    Intent intent1 = new Intent(context, LunBoDetailsActivity.class);
                    intent1.putExtra("info", info1);
                    context.startActivity(intent1);
                }
            });
            holder.ll_there.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen3s.get(2).getTitle());
                    info.setUrl(listBeen3s.get(2).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_four.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen3s.get(3).getTitle());
                    info.setUrl(listBeen3s.get(3).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_five.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen3s.get(4).getTitle());
                    info.setUrl(listBeen3s.get(4).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });


        } else if (position == 4) {
            final List<ClothespressInfo.DataBean.CBSportsBean.ListBean> listBeen4 = clothespressInfo.getData().getCB_sports().getList();
            final List<ClothespressInfo.DataBean.NPPSportsBean.ListBean> listBeen4s = clothespressInfo.getData().getNPP_sports().getList();
            Picasso.with(context).load(listBeen4.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_title);
            Picasso.with(context).load(listBeen4s.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_one);
            holder.head_one.setText(listBeen4s.get(0).getTitle());
            holder.title_one.setText(listBeen4s.get(0).getViceTitle());
            Picasso.with(context).load(listBeen4s.get(1).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_two);
            holder.head_two.setText(listBeen4s.get(1).getTitle());
            holder.title_two.setText(listBeen4s.get(1).getViceTitle());
            Picasso.with(context).load(listBeen4s.get(2).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_there);
            holder.head_there.setText(listBeen4s.get(2).getTitle());
            holder.title_there.setText(listBeen4s.get(2).getViceTitle());
            Picasso.with(context).load(listBeen4s.get(3).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_four);
            holder.head_four.setText(listBeen4s.get(3).getTitle());
            holder.title_four.setText(listBeen4s.get(3).getViceTitle());
            Picasso.with(context).load(listBeen4s.get(4).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_five);
            holder.head_five.setText(listBeen4s.get(4).getTitle());
            holder.title_five.setText(listBeen4s.get(4).getViceTitle());
            holder.iv_title.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen4.get(0).getTitle());
                    info.setUrl(listBeen4.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_one.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen4s.get(0).getTitle());
                    info.setUrl(listBeen4s.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_two.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info1 = new Info();
                    info1.setTitle(listBeen4s.get(1).getTitle());
                    info1.setUrl(listBeen4s.get(1).getLink());
                    Intent intent1 = new Intent(context, LunBoDetailsActivity.class);
                    intent1.putExtra("info", info1);
                    context.startActivity(intent1);
                }
            });
            holder.ll_there.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen4s.get(2).getTitle());
                    info.setUrl(listBeen4s.get(2).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_four.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen4s.get(3).getTitle());
                    info.setUrl(listBeen4s.get(3).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_five.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen4s.get(4).getTitle());
                    info.setUrl(listBeen4s.get(4).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });


        } else if (position == 5) {
            final List<ClothespressInfo.DataBean.CBMagicBean.ListBean> listBeen5 = clothespressInfo.getData().getCB_magic().getList();
            final List<ClothespressInfo.DataBean.NPPMagicBean.ListBean> listBeen5s = clothespressInfo.getData().getNPP_magic().getList();
            Picasso.with(context).load(listBeen5.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_title);
            Picasso.with(context).load(listBeen5s.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_one);
            holder.head_one.setText(listBeen5s.get(0).getTitle());
            holder.title_one.setText(listBeen5s.get(0).getViceTitle());
            Picasso.with(context).load(listBeen5s.get(1).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_two);
            holder.head_two.setText(listBeen5s.get(1).getTitle());
            holder.title_two.setText(listBeen5s.get(1).getViceTitle());
            Picasso.with(context).load(listBeen5s.get(2).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_there);
            holder.head_there.setText(listBeen5s.get(2).getTitle());
            holder.title_there.setText(listBeen5s.get(2).getViceTitle());
            Picasso.with(context).load(listBeen5s.get(3).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_four);
            holder.head_four.setText(listBeen5s.get(3).getTitle());
            holder.title_four.setText(listBeen5s.get(3).getViceTitle());
            Picasso.with(context).load(listBeen5s.get(4).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_five);
            holder.head_five.setText(listBeen5s.get(4).getTitle());
            holder.title_five.setText(listBeen5s.get(4).getViceTitle());
            holder.iv_title.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen5.get(0).getTitle());
                    info.setUrl(listBeen5.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_one.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen5s.get(0).getTitle());
                    info.setUrl(listBeen5s.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_two.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info1 = new Info();
                    info1.setTitle(listBeen5s.get(1).getTitle());
                    info1.setUrl(listBeen5s.get(1).getLink());
                    Intent intent1 = new Intent(context, LunBoDetailsActivity.class);
                    intent1.putExtra("info", info1);
                    context.startActivity(intent1);
                }
            });
            holder.ll_there.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen5s.get(2).getTitle());
                    info.setUrl(listBeen5s.get(2).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_four.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen5s.get(3).getTitle());
                    info.setUrl(listBeen5s.get(3).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_five.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen5s.get(4).getTitle());
                    info.setUrl(listBeen5s.get(4).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });

        } else if (position == 6) {
            final List<ClothespressInfo.DataBean.CBHouseholdBean.ListBean> listBeen6 = clothespressInfo.getData().getCB_household().getList();
            final List<ClothespressInfo.DataBean.NPPHouseholdBean.ListBean> listBeen6s = clothespressInfo.getData().getNPP_household().getList();
            Picasso.with(context).load(listBeen6.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_title);
            Picasso.with(context).load(listBeen6s.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_one);
            holder.head_one.setText(listBeen6s.get(0).getTitle());
            holder.title_one.setText(listBeen6s.get(0).getViceTitle());
            Picasso.with(context).load(listBeen6s.get(1).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_two);
            holder.head_two.setText(listBeen6s.get(1).getTitle());
            holder.title_two.setText(listBeen6s.get(1).getViceTitle());
            Picasso.with(context).load(listBeen6s.get(2).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_there);
            holder.head_there.setText(listBeen6s.get(2).getTitle());
            holder.title_there.setText(listBeen6s.get(2).getViceTitle());
            Picasso.with(context).load(listBeen6s.get(3).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_four);
            holder.head_four.setText(listBeen6s.get(3).getTitle());
            holder.title_four.setText(listBeen6s.get(3).getViceTitle());
            Picasso.with(context).load(listBeen6s.get(4).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_five);
            holder.head_five.setText(listBeen6s.get(4).getTitle());
            holder.title_five.setText(listBeen6s.get(4).getViceTitle());
            holder.iv_title.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen6.get(0).getTitle());
                    info.setUrl(listBeen6.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_one.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen6s.get(0).getTitle());
                    info.setUrl(listBeen6s.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_two.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info1 = new Info();
                    info1.setTitle(listBeen6s.get(1).getTitle());
                    info1.setUrl(listBeen6s.get(1).getLink());
                    Intent intent1 = new Intent(context, LunBoDetailsActivity.class);
                    intent1.putExtra("info", info1);
                    context.startActivity(intent1);
                }
            });
            holder.ll_there.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen6s.get(2).getTitle());
                    info.setUrl(listBeen6s.get(2).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_four.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen6s.get(3).getTitle());
                    info.setUrl(listBeen6s.get(3).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_five.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen6s.get(4).getTitle());
                    info.setUrl(listBeen6s.get(4).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });

        } else if (position == 7) {
            final List<ClothespressInfo.DataBean.CBFoodBean.ListBean> listBeen7 = clothespressInfo.getData().getCB_food().getList();
            final List<ClothespressInfo.DataBean.NPPFoodBean.ListBean> listBeen7s = clothespressInfo.getData().getNPP_food().getList();
            Picasso.with(context).load(listBeen7.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_title);
            Picasso.with(context).load(listBeen7s.get(0).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_one);
            holder.head_one.setText(listBeen7s.get(0).getTitle());
            holder.title_one.setText(listBeen7s.get(0).getViceTitle());
            Picasso.with(context).load(listBeen7s.get(1).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_two);
            holder.head_two.setText(listBeen7s.get(1).getTitle());
            holder.title_two.setText(listBeen7s.get(1).getViceTitle());
            Picasso.with(context).load(listBeen7s.get(2).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_there);
            holder.head_there.setText(listBeen7s.get(2).getTitle());
            holder.title_there.setText(listBeen7s.get(2).getViceTitle());
            Picasso.with(context).load(listBeen7s.get(3).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_four);
            holder.head_four.setText(listBeen7s.get(3).getTitle());
            holder.title_four.setText(listBeen7s.get(3).getViceTitle());
            Picasso.with(context).load(listBeen7s.get(4).getImage()).fit().config(Bitmap.Config.RGB_565).into(holder.iv_five);
            holder.head_five.setText(listBeen7s.get(4).getTitle());
            holder.title_five.setText(listBeen7s.get(4).getViceTitle());
            holder.iv_title.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen7.get(0).getTitle());
                    info.setUrl(listBeen7.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_one.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen7s.get(0).getTitle());
                    info.setUrl(listBeen7s.get(0).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_two.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info1 = new Info();
                    info1.setTitle(listBeen7s.get(1).getTitle());
                    info1.setUrl(listBeen7s.get(1).getLink());
                    Intent intent1 = new Intent(context, LunBoDetailsActivity.class);
                    intent1.putExtra("info", info1);
                    context.startActivity(intent1);
                }
            });
            holder.ll_there.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen7s.get(2).getTitle());
                    info.setUrl(listBeen7s.get(2).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_four.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen7s.get(3).getTitle());
                    info.setUrl(listBeen7s.get(3).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });
            holder.ll_five.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Info info = new Info();
                    info.setTitle(listBeen7s.get(4).getTitle());
                    info.setUrl(listBeen7s.get(4).getLink());
                    Intent intent = new Intent(context, LunBoDetailsActivity.class);
                    intent.putExtra("info", info);
                    context.startActivity(intent);
                }
            });

        }

    }

    @Override
    public int getItemCount() {
        return 8;
    }

    public class ClothesRecyclerviewViewHolder extends RecyclerView.ViewHolder {
        private RecyclerImageView iv_title;
        private TextView head_one;
        private TextView title_one;
        private RecyclerImageView iv_one;
        private RelativeLayout ll_one;
        private TextView head_two;
        private TextView title_two;
        private RecyclerImageView iv_two;
        private RelativeLayout ll_two;
        private TextView head_four;
        private TextView title_four;
        private RecyclerImageView iv_four;
        private RelativeLayout ll_four;
        private TextView head_there;
        private TextView title_there;
        private RecyclerImageView iv_there;
        private RelativeLayout ll_there;
        private TextView head_five;
        private TextView title_five;
        private RecyclerImageView iv_five;
        private RelativeLayout ll_five;

        public ClothesRecyclerviewViewHolder(View itemView) {
            super(itemView);
            iv_title = (RecyclerImageView) itemView.findViewById(R.id.iv_title);
            head_one = (TextView) itemView.findViewById(R.id.head_one);
            title_one = (TextView) itemView.findViewById(R.id.title_one);
            iv_one = (RecyclerImageView) itemView.findViewById(R.id.iv_one);
            ll_one = (RelativeLayout) itemView.findViewById(R.id.ll_one);
            head_two = (TextView) itemView.findViewById(R.id.head_two);
            title_two = (TextView) itemView.findViewById(R.id.title_two);
            iv_two = (RecyclerImageView) itemView.findViewById(R.id.iv_two);
            ll_two = (RelativeLayout) itemView.findViewById(R.id.ll_two);
            head_four = (TextView) itemView.findViewById(R.id.head_four);
            title_four = (TextView) itemView.findViewById(R.id.title_four);
            iv_four = (RecyclerImageView) itemView.findViewById(R.id.iv_four);
            ll_four = (RelativeLayout) itemView.findViewById(R.id.ll_four);
            head_there = (TextView) itemView.findViewById(R.id.head_there);
            title_there = (TextView) itemView.findViewById(R.id.title_there);
            iv_there = (RecyclerImageView) itemView.findViewById(R.id.iv_there);
            ll_there = (RelativeLayout) itemView.findViewById(R.id.ll_there);
            head_five = (TextView) itemView.findViewById(R.id.head_five);
            title_five = (TextView) itemView.findViewById(R.id.title_five);
            iv_five = (RecyclerImageView) itemView.findViewById(R.id.iv_five);
            ll_five = (RelativeLayout) itemView.findViewById(R.id.ll_five);

        }
    }


}
